﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
	<base href="<%=basePath%>">
	<!-- jsp文件头和头部 -->
	<%@ include file="../../system/main/main_top.jsp"%> 
	</head> 
<body>
<div class="container-fluid" id="main-container">
<div id="breadcrumbs">
	<ul class="breadcrumb">
		<li><i class="icon-home"></i> <a>商户管理</a> <span class="divider">
				<i class="icon-angle-right"></i>
		</span></li>
		<li class="active">创建群组</li>
	</ul>
	<!--.breadcrumb-->
</div>
<div id="page-content" class="clearfix">
  <div class="row-fluid">
	<div class="row-fluid">
			<!-- 检索  -->
			<table id="table_report" class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
						<th>序号</th>
						<th>群组ID</th>
						<th>群组名称</th>
						<th>操作</th>
					</tr>
				</thead>
										
				<tbody>
				<!-- 开始循环 -->	
				<c:choose>
					<c:when test="${not empty meetGroupList}">
						<c:forEach items="${meetGroupList}" var="var" varStatus="vs">
							<tr>
								<td class='center' style="width: 30px;">${vs.index+1}</td>
								<td>${var.group_id }</td>
								<td>${var.group_name }</td>
								<td style="width: 60px;">
									<div class='hidden-phone visible-desktop btn-group'>
									 	<a class="btn btn-small btn-success" onclick="delMeetGroup('${var.group_id }','${var.group_name }');">解散群组</a>
									</div>
								</td>
							</tr>
						</c:forEach>
						
						<!-- <tr>
							<td colspan="100" class="center">您无权查看</td>
						</tr> -->
					</c:when>
					<c:otherwise>
						<tr class="main_info">
							<td colspan="100" class="center" >没有相关数据</td>
						</tr>
					</c:otherwise>
				</c:choose>
				</tbody>
			</table>
			
		<div class="page-header position-relative">
		<table style="width:100%;">
			<tr>
				<td style="vertical-align:top;"><a class="btn btn-small btn-success" onclick="add('${pageData.organ_id }');">新增</a></td>
			</tr>
		</table>
		</div>
	</div>
	<!-- PAGE CONTENT ENDS HERE -->
  </div><!--/row-->
	
</div><!--/#page-content-->
</div><!--/.fluid-container#main-container-->
		<!-- 返回顶部  -->
		<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse">
			<i class="icon-double-angle-up icon-only"></i>
		</a>
		
		<!-- 引入 -->
		<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script type="text/javascript" src="static/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="static/js/ace-elements.min.js"></script>
		<script type="text/javascript" src="static/js/ace.min.js"></script>
		<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 单选框 -->
		<script type="text/javascript" src="static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
		<script type="text/javascript" src="static/js/bootbox.min.js"></script><!-- 确认窗口 -->
		<!-- 引入 -->
		
		<script type="text/javascript">
		$(top.hangge());
		
		//新增
		function add(organ_id){
			top.jzts();
			var diag = new top.Dialog();
			diag.Drag=true;
			diag.Title ="新增";
			diag.URL = '<%=basePath%>commercial/group/goAddGroup.do?organ_id='+organ_id;
			diag.Width = 400;
			diag.Height = 150;
			diag.CancelEvent = function(){ //关闭事件
				if(diag.innerFrame.contentWindow.document.getElementById('centerOfMainFrame').style.display == 'none'){
					top.jzts();
					setTimeout("self.location.reload()",100);
				}
				diag.close();
			 };
			 diag.show();
		}
		
		//删除
		function delMeetGroup(id, msg){
			bootbox.confirm("确定要删除群组["+msg+"]吗?", function(result) {
				if(result) {
					var url = '<%=basePath%>commercial/group/deleteMeetGroup.do?group_id=' + id + '&tm='+new Date().getTime();
					$.get(url,function(data){
						top.jzts();
						setTimeout("self.location.reload()",100);
					});
				}
			});
		}
		</script>
	</body>
</html>

